
//
//  BDHomeDetailInfoTableViewCell.m
//  BadBoy
//
//  Created by wen on 2017/3/21.
//  Copyright © 2017年 com.8xiong. All rights reserved.
//

#import "BDHomeDetailInfoTableViewCell.h"

@interface BDHomeDetailInfoTableViewCell ()

@property (nonatomic, strong) UIView *upLine;
@property (nonatomic, strong) UIView *downLine;

@end

@implementation BDHomeDetailInfoTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    style = UITableViewCellStyleValue1;
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.imageView.size = CGSizeMake(20, 20);
    self.imageView.left = 10;
    self.imageView.centerY = self.height / 2.0;
    
    self.textLabel.font = [UIFont systemFontOfSize:14];
    self.textLabel.left = self.imageView.right + 10;
    self.textLabel.width = [self.textLabel.text widthWithFont:self.textLabel.font];
    self.textLabel.height = 16;
    self.textLabel.centerY = self.height / 2.0;
    
    self.detailTextLabel.font = [UIFont systemFontOfSize:14];
    [self.detailTextLabel sizeToFit];
    self.detailTextLabel.right = self.width - 15;
    self.detailTextLabel.centerY = self.height / 2.0;
    
    self.downLine.bottom = self.height;
    self.upLine.hidden = self.isFirst;
}

- (UIView *)upLine{
    if (!_upLine) {
        self.upLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kBDScreenWidth, 0.5)];
        _upLine.backgroundColor = kBDColorGray;
        [self.contentView addSubview:_upLine];
    }
    return _upLine;
}

- (UIView *)downLine{
    if (!_downLine) {
        self.downLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kBDScreenWidth, 0.5)];
        _downLine.backgroundColor = kBDColorGray;
        [self.contentView addSubview:_downLine];
    }
    return _downLine;
}

@end
